/**
 * @author lwlianghehe@gmail.com
 * @date 2025/08/04
 */

export interface HyperlinkData {
  text: string;
  link: string;
}

export interface CodeBlockData {
  code: string;
  language?: string;
}

export interface WatermarkData {
  content: string;
  color: string;
  fontSize: number;
  opacity: number;
  repeat: number;
  horizontalSpacing: number;
  verticalSpacing: number;
}

export interface LatexData {
  content: string;
}

export interface ContentBlockData {
  type: 'iframe' | 'video';
  width: number | undefined;
  height: number | undefined;
  address: string;
  html: string;
}

export interface SearchReplaceData {
  findText: string;
  replaceText: string;
  matchCase: boolean;
  matchWholeWord: boolean;
}

export interface SignatureData {
  value: string;  // base64 图片数据
  width: number;  // 图片宽度
  height: number; // 图片高度
}

export interface CommentData {
  content: string; // 批注内容
}

// 控件值集项
export interface ControlValueItem {
  value: string;
  code: string;
}

// 基础控件数据
export interface BaseControlData {
  placeholder: string;
  defaultValue: string;
}

// 文本控件数据
export interface TextControlData extends BaseControlData {
  type: 'text';
}

// 数值控件数据
export interface NumberControlData extends BaseControlData {
  type: 'number';
}

// 枚举控件数据
export interface EnumControlData extends BaseControlData {
  type: 'enum';
  valueSet: ControlValueItem[];
}

// 日期控件数据
export interface DateControlData extends BaseControlData {
  type: 'date';
  dateFormat: string;
}

// 复选框控件数据
export interface CheckboxControlData extends BaseControlData {
  type: 'checkbox';
  valueSet: ControlValueItem[];
}

// 单选框控件数据
export interface RadioControlData extends BaseControlData {
  type: 'radio';
  valueSet: ControlValueItem[];
}

// 联合类型
export type ControlData = 
  | TextControlData 
  | NumberControlData 
  | EnumControlData 
  | DateControlData 
  | CheckboxControlData 
  | RadioControlData;